#include <ir/ir.h>

namespace ir {
  CompUnit::~CompUnit() {
    vector_clear_pointer(this->global_reg_list);
    vector_clear_pointer(this->func_list);
    vector_clear_pointer(this->inst_global_alloc_list);
  }

  Func::~Func() {
    vector_clear_pointer(this->arg_list);
    vector_clear_pointer(this->block_list);
    vector_clear_pointer(this->array_info_list);
  }

  void Func::accept(riscv::Visitor & visitor) {
    visitor.visit(*this);
  }

  std::string Func::get_name() {
    return this->name;
  }

}
